<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="/admin/header.jsp"></jsp:include>
<div class="main">
	<div class="body container">
		<div class="typecho-page-title">
			<h2>个人设置</h2>
		</div>
		<div class="row typecho-page-main">
			<div class="col-mb-12 col-tb-3">
				<p>
					<a href="${options.siteUrl}/admin/updateUserPic" title="修改头像"
						target="_blank"><img class="profile-avatar"
						src="http://www.guxingke.com/image/user/default.jpg" alt="孤星可"></a>
				</p>
				<h2>${user['screenName']}</h2>
				<p>${user['group']}</p>
				<p>
					目前有 <em>${stat['publishedPostsNum']}</em> 篇文章, 并有 <em>${stat['publishedCommentsNum']}</em>
					条关于你的评论在 <em>${stat['categoriesNum']}</em> 个分类中.
				</p>
				<p>最后登录: ${user['logged']}</p>
			</div>

			<div class="col-mb-12 col-tb-6 col-tb-offset-1 typecho-content-panel"
				role="form">
				<section>
					<h3>个人资料</h3>
					<form action="${options.siteUrl}/action/admin?do=updateProfile"
						method="post" enctype="application/x-www-form-urlencoded">
						<ul class="typecho-option" id="typecho-option-item-screenName-0">
							<li><label class="typecho-label" for="screenName-0-1">
									昵称</label> <input id="screenName-0-1" name="user.screenName"
								type="text" class="text" value="${user['screenName']}">
								<p class="description">
									用户昵称可以与用户名不同, 用于前台显示.<br>如果你将此项留空, 将默认使用用户名.
								</p></li>
						</ul>
						<ul class="typecho-option" id="typecho-option-item-url-1">
							<li><label class="typecho-label" for="url-0-2">
									个人主页地址</label> <input id="url-0-2" name="user.url" type="text"
								class="text" value="${user['url'] }">
								<p class="description">
									此用户的个人主页地址, 请用
									<code>http://</code>
									开头.
								</p></li>
						</ul>
						<ul class="typecho-option" id="typecho-option-item-mail-2">
							<li><label class="typecho-label" for="mail-0-3">
									电子邮箱地址 *</label> <input id="mail-0-3" name="user.mail" type="text"
								class="text" value="${user['mail']}">
								<p class="description">
									电子邮箱地址将作为此用户的主要联系方式.<br>请不要与系统中现有的电子邮箱地址重复.
								</p></li>
						</ul>
						<ul class="typecho-option" id="typecho-option-item-do-3"
							style="display: none">
							<li><input name="user.uid" type="hidden"
								value="${user['uid']}"></li>
						</ul>
						<ul class="typecho-option typecho-option-submit"
							id="typecho-option-item-submit-4">
							<li>
								<button type="submit" class="btn primary">更新我的档案</button>
							</li>
						</ul>
					</form>
				</section>

				<br />

				<section id="writing-option">
					<h3>撰写设置</h3>
					<form action="${options.siteUrl}/action/admin?do=updateEditOption"
						method="post" enctype="application/x-www-form-urlencoded">

						<ul class="typecho-option" id="typecho-option-item-defaultAllow-7">
							<li><label class="typecho-label"> 默认允许</label> <span>
									<c:if test="${editOption.defaultAllowComment==false}">
										<input name="defaultAllow[]" type="checkbox" value="comment"
											id="defaultAllow-comment">
									</c:if> <c:if test="${editOption.defaultAllowComment==true}">
										<input name="defaultAllow[]" type="checkbox" value="comment"
											id="defaultAllow-comment" checked="true">
									</c:if> <label for="defaultAllow-comment"> 可以被评论</label>
							</span> <span> <c:if test="${editOption.defaultAllowPing==false}">
										<input name="defaultAllow[]" type="checkbox" value="ping"
											id="defaultAllow-ping">
									</c:if> <c:if test="${editOption.defaultAllowPing==true}">
										<input name="defaultAllow[]" type="checkbox" value="ping"
											id="defaultAllow-ping" checked="true">
									</c:if> <label for="defaultAllow-ping"> 可以被引用</label>
							</span> <span> <c:if test="${editOption.defaultAllowFeed==false}">
										<input name="defaultAllow[]" type="checkbox" value="feed"
											id="defaultAllow-ping">
									</c:if> <c:if test="${editOption.defaultAllowFeed==true}">
										<input name="defaultAllow[]" type="checkbox" value="feed"
											id="defaultAllow-ping" checked="true">
									</c:if> <label for="defaultAllow-feed"> 出现在聚合中</label>
							</span>
								<p class="description">设置你经常使用的默认允许权限</p></li>
						</ul>
						<!-- <ul class="typecho-option" id="typecho-option-item-do-8"
							style="display: none">
							<li><input name="do" type="hidden" value="options">
							</li>
						</ul> -->
						<ul class="typecho-option typecho-option-submit"
							id="typecho-option-item-submit-9">
							<li>
								<button type="submit" class="btn primary">保存设置</button>
							</li>
						</ul>
					</form>
				</section>

				<br />

				<section id="change-password">
					<h3>密码修改</h3>
					<p style="color: red">${error}</p>
					<form
						action="${options.siteUrl}/action/admin?do=updateUserPassword"
						method="post" enctype="application/x-www-form-urlencoded">
						<ul class="typecho-option" id="typecho-option-item-password-10">
							<li><label class="typecho-label" for="password-0-11">
									用户密码</label> <input id="password-0-11" name="user.password"
								type="password" class="w-60">
								<p class="description">
									为此用户分配一个密码.<br>建议使用特殊字符与字母、数字的混编样式,以增加系统安全性.
								</p></li>
						</ul>
						<ul class="typecho-option" id="typecho-option-item-confirm-11">
							<li><label class="typecho-label" for="confirm-0-12">
									用户密码确认</label> <input id="confirm-0-12" name="confirm" type="password"
								class="w-60">
								<p class="description">请确认你的密码, 与上面输入的密码保持一致.</p></li>
						</ul>
						<ul class="typecho-option" id="typecho-option-item-do-12"
							style="display: none">
							<li><input name="user.uid" type="hidden"
								value="${user['uid']}"></li>
						</ul>
						<ul class="typecho-option typecho-option-submit"
							id="typecho-option-item-submit-13">
							<li>
								<button type="submit" class="btn primary">更新密码</button>
							</li>
						</ul>
					</form>
				</section>
			</div>
		</div>
	</div>
</div>
<jsp:include page="/admin/copyright.jsp"></jsp:include>
<jsp:include page="/admin/common-js.jsp"></jsp:include>
<script src="${options.siteUrl}/admin/js/form.js"></script>
<jsp:include page="/admin/footer.jsp"></jsp:include>
